/**
 * 
 */
package com.google.code.jkippt.query;

import java.util.Calendar;

/**
 * {@link ClipQuery} builder.
 * @author Federico De Faveri defaveri@gmail.com
 */
public class ClipQueryBuilder {
	
	protected ClipQuery query;
	
	public ClipQueryBuilder()
	{
		this.query = new ClipQuery();
	}
	
	/**
	 * Includes List in the results;
	 * @return this {@link ClipQueryBuilder} instance.
	 */
	public ClipQueryBuilder includeList()
	{
		query.setIncludeList(true);
		return this;
	}
	
	/**
	 * Includes Via in the results;
	 * @return this {@link ClipQueryBuilder} instance.
	 */
	public ClipQueryBuilder includeVia()
	{
		query.setIncludeVia(true);
		return this;
	}
	
	/**
	 * Includes Media in the results;
	 * @return this {@link ClipQueryBuilder} instance.
	 */
	public ClipQueryBuilder includeMedia()
	{
		query.setIncludeMedia(true);
		return this;
	}
	
	/**
	 * Filter by url to see if a specific url has been saved.
	 * @param url the url to use as filter.
	 * @return this {@link ClipQueryBuilder} instance.
	 */
	public ClipQueryBuilder url(String url)
	{
		query.setUrl(url);
		return this;
	}
	
	/**
	 * Updated after specific timestamp.
	 * @param date
	 * @return this {@link ClipQueryBuilder} instance.
	 */
	public ClipQueryBuilder since(Calendar date)
	{
		query.setSince(date);
		return this;
	}
	
	/**
	 * Builds the {@link ClipQuery}.
	 * @return this {@link ClipQueryBuilder} instance.
	 */
	public ClipQuery build()
	{
		return query;
	}

}
